home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
falcon
/
programm.ing
/
falclib.lzh
/
EXAMPLE
/
GEMSTUF2.S
< prev
next >
Wrap
Text File
|
1994-08-17
|
2KB
|
105 lines
*********************************************************
* *
* A window demonstration *
* *
*********************************************************
include releasem.s release unused memory
include getpar.s find where the parameters are kept
move.l a0,parbuf save it
bra main
include gemmacro.i this one is supplied with devpac
include shrtones.s
include window.s
wtype equ %01111 info, move, full, close and name
windowname dc.b 'hello world',0
main move #32,xstart window start position
move #50,ystart
move #380,xwidth window size
move #150,ywidth
bsr @createwindow
menu_register ap_id,#applname ; set the name of the application
wait evnt_multi #%010010,#1,#1,#1,#0,#0,#0,#0,#0,#0,#0,#0,#0,#0,#msgbuf,#0 ;get message and button events
btst.b #4,int_out+1
bne msgevent
msgready btst.b #1,int_out+1
bne buttonevent
bra wait
msgevent move msgbuf,d0
cmp #20,d0 is it an update event?
beq redraw
cmp #22,d0 was the close box pressed?
beq exit
cmp #28,d0 was the window moved?
beq moved
cmp #23,d0 was the full button pressed
beq full
cmp #21,d0 was the window topped?
beq topped
cmp #33,d0 was it bottomed?
beq bottomed
bra msgready it was something unimportant
buttonevent lea rsrc,a0
bsr @button
cmp #1,d0 did someone press my button?
beq button1 yes!
bra wait nothing of importance was clicked on
button1 form_alert alertbutton,#alerttext
bra wait
exit bsr @exitwindow
bra @quit
redraw move.l #rsrc,a0
bsr @updatersrc
bra msgready
moved lea msgbuf,a0
bsr @moveit
bra msgready
bottomed lea msgbuf,a0
bsr @bottomwindow
bra msgready
topped lea msgbuf,a0
bsr @topwindow
bra msgready
full fsel_exinput #path,#filen,#title
bra msgready
rsrc dc.w -1,1,1,20,0,0,4,1,0,0,380,150
dc.w 0,-1,-1,26,1,0
dc.l buttontext
dc.w 50,50,100,16
path dc.b 'c:\*.*',0
ds.b 150
filen ds.b 20
title dc.b 'load a file or something',0
buttontext dc.b 'a button',0
even
alertbutton dc.w 1
alerttext dc.b '[2][You have not saved anything|are you sure you want to quit?][ Yes ]',0
applname dc.b ' here I am',0
include aeslib.s supplied with devpac
include vdilib.s supplied with devpac
section bss
msgbuf ds.w 20
parbuf ds.l 1